<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@page import="Dao.*,JavaBean.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
	    request.setCharacterEncoding("UTF-8");
		String  userId=request.getParameter("UserId");
		UserDao  dao=new UserDao();
		
		int result=dao.delete(Integer.parseInt(userId)); 
		if(result>0){
			 out.println("<script>alert('删除成功！！');</script>"); 
		     out.println("<script>window.location.href='UserList.jsp'</script>");
			
		}
		if(result==-1){
			out.println("<script>alert('删除失败！！');</script>");
			out.println("<script>window.location.herf='UserList.jsp'");
		}
		if(result==-2){
			out.println("<script>alert('连接错误！！');</script>");
			out.println("<script>window.location.herf='UserList.jsp'");
		}
		
	%>
</body>
</html>